<?php
Route::group(['prefix' => 'shop', 'namespace' => 'Shop', 'as' => 'shop.'], function () {
    //品牌管理
    Route::group(['prefix' => 'brand'], function () {
        Route::patch('change_attr', 'BrandController@change_attr')->name('brand.change_attr');
        Route::patch('sort_order', 'BrandController@sort_order')->name('brand.sort_order');
        Route::delete('destroy_all', 'BrandController@destroy_all')->name('brand.destroy_all');
    });
    Route::resource('brand', 'BrandController');

    //分类管理
    Route::group(['prefix' => 'category'], function () {
        Route::patch('change_attr', 'CategoryController@change_attr')->name('category.change_attr');
        Route::patch('sort_order', 'CategoryController@sort_order')->name('category.sort_order');
    });
    Route::resource('category', 'CategoryController');

    //商品管理
    Route::group(['prefix' => 'product'], function () {
        Route::delete('delete_img', 'ProductController@delete_img')->name('product.delete_img');
        Route::patch('change_attr', 'ProductController@change_attr')->name('product.change_attr');
        Route::patch('stock', 'ProductController@stock')->name('product.stock');
        Route::patch('price', 'ProductController@price')->name('product.price');
        Route::patch('recycle_one', 'ProductController@recycle_one')->name('product.recycle_one');
        Route::patch('recycle_all', 'ProductController@recycle_all')->name('product.recycle_all');
    });
    Route::resource('product', 'ProductController');

    //回收站
    Route::group(['prefix' => 'recycle'], function () {
        Route::patch('restore_one', 'RecycleController@restore_one')->name('recycle.restore_one');
        Route::patch('restore_all', 'RecycleController@restore_all')->name('recycle.restore_all');
        Route::delete('delete_all', 'RecycleController@delete_all')->name('recycle.delete_all');

    });
    Route::resource('recycle', 'RecycleController');

    //会员管理
    Route::group(['prefix' => 'customer'], function () {
        Route::patch('change_attr', 'CustomerController@change_attr')->name('customer.change_attr'); //改变性别
    });
    Route::resource('customer', 'CustomerController');

    //物流查询
    Route::group(['prefix' => 'express'], function () {
        Route::patch('change_attr', 'ExpressController@change_attr')->name('express.change_attr');
        Route::patch('sort_order', 'ExpressController@sort_order')->name('express.sort_order');
        Route::delete('delete_all', 'ExpressController@delete_all')->name('express.delete_all');
    });

    Route::resource('express', 'ExpressController');

    //数据可视化
    Route::get('/', 'HomeController@index')->name('home');

    //抽奖大转盘
    Route::get('/prize', 'PrizeController@index')->name('prize');
    Route::post('/draw', 'PrizeController@draw')->name('draw');


});

